package com.frt.sygang.common;/**
 * Created by 冯瑞涛 on 2022/9/18 16:17
 */

/**
 * @author 冯瑞涛
 * @version 1.0
 * @date 2022/9/18 16:17
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    /**
     * 将数据存入当前线程
     *
     * @param id
     */
    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    /**
     * 将当前线程存储数据返回
     *
     * @return
     */
    public static Long getCurrentId() {
        return threadLocal.get();
    }
}
